package day6;

import java.util.Scanner;

public class Demo8 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("请输入你的字符串:");
        String line = in.nextLine();

        char[] s1 = line.toCharArray();

        int ch = 0;
        int digit = 0;

        for (int i = 0; i < s1.length; i++){
            if ((s1[i] <= 'z' && s1[i] >= 'a') || (s1[i] <= 'Z' && s1[i] >= 'A')){
                ++ch;
            } else if (s1[i] <= '9' && s1[i] >= '0'){
                ++digit;
            }
        }

        System.out.println("英文字数为:" + ch);
        System.out.println("数字个数为:" + digit);

    }
}
